/**
 * 系统时间操作
 *
 * @export
 * @class DateTime
 */
export default class DateTime {

    /**
     * 打开日期 对话框
     *
     * @static
     * @param {string} [option={ title:"请选择日期：", date: '2018-06-06', minDate: '2000-01-01', maxDate : '2010-01-01' }]
     * @returns
     * @memberof DateTime
     */
    static openDate(option = { title:"请选择日期：" }) {
        return new Promise((resolve, reject) => {
            plus.nativeUI.pickDate(res => {
                resolve(res.date);
            }, error => {
                reject(error);
            }, option);
        });
    }

    /**
     * 打开时间 对话框 
     *
     * @static
     * @memberof DateTime
     */
    static openTime(option = { title:"请选择时间：" }) {
        return new Promise((resolve, reject) => {
            plus.nativeUI.pickTime(res => {
                resolve(res.date);
            }, error => {
                reject(error);
            }, option);
        });
    }
}